<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>转换为布尔</title>
</head>
<body>
<script type="text/javascript">
  let a = 6;

  a = Boolean(a);
  console.log(a);
  console.log(typeof a);

  let b = "1344za";

  a = Boolean(b);
  console.log(b);
  console.log(typeof b);

</script>
</body>
</html>